<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 打印倒三角 -->
    <script>
        // 循环行数
        for (let i = 1; i <= 5; i++) {
            // 循环次数
            for (let num = 1; num <= i; num++) {
                document.write('☆')
            }
            // 每次循环都要换行
            document.write('<br>')
        }
    </script>
</body>

</html>